#ifndef __FH_MSHC_LITE_DLL_H__
#define __FH_MSHC_LITE_DLL_H__
/*****************************************************************************
 *  Include Section
 *  add all #include here
 *****************************************************************************/
#include "fh_mshc_lite.h"
#include <linux/platform_device.h>
#include <mach/fh_predefined.h>


/*****************************************************************************
 * Define section
 * add all #define here
 *****************************************************************************/
#define PHY_MAX_BIT_WIDTH_1		0
#define PHY_MAX_BIT_WIDTH_4		1
#define PHY_MAX_BIT_WIDTH_8		3

#define PHY_TX_DRI_SEL_CLK_EMMC		0
#define PHY_TX_DRI_SEL_CLK_EMMC_2X	1

#define PHY_RX_DATA_SEL_CLK_EMMC	0
#define PHY_RX_DATA_SEL_CLK_DS		1

#define PHY_RX_CMD_SEL_CLK_EMMC		0
#define PHY_RX_CMD_SEL_CLK_DS		1

#define PHY_TX_DRI_INV_ENABLE	1
#define PHY_TX_DRI_INV_DISABLE	0

#define PHY_RX_DATA_SAMPLE_INV_ENABLE	1
#define PHY_RX_DATA_SAMPLE_INV_DISABLE	0

#define PHY_RX_CMD_SAMPLE_INV_ENABLE	1
#define PHY_RX_CMD_SAMPLE_INV_DISABLE	0

#define PHY_BY_PASS_DELAY_FUNC	0xdeadbeef

#define INIT_INV_ENABLE			1
#define INIT_INV_DISABLE		0
#define AUTO_TUNING_PARA_ALREADY_GOT 0x1
#define AUTO_TUNING_PARA_NULL 0x0

/****************************************************************************
 * ADT section
 * add definition of user defined Data Type that only be used in this file here
 ***************************************************************************/
struct fh_mshc_phy_dll {
u32 tx_dly;
u32 rxdata_dly;
u32 rxcmd_dly;
};

/*****************************************************************************
 * func section
 *****************************************************************************/
void phy_clear_rxfifo(struct fh_mshc_lite *p_mshc);
void phy_tx_dri_clk_sel(struct fh_mshc_lite *p_mshc, u32 sel);
void phy_rx_cmd_sample_clk_sel(struct fh_mshc_lite *p_mshc, u32 sel);
void phy_rx_data_sample_clk_sel(struct fh_mshc_lite *p_mshc, u32 sel);
int mshc_auto_get_mmc_cid(struct fh_mshc_lite *p_mshc, u32 *ret_cid, u8 *emmc_name);
struct mshc_lite_emmc_card_info * emmc_name_to_plat_info(struct mshc_lite_emmc_card_info *info, char *emmc_name);
void fh_mshc_lite_hw_reset(struct fh_mshc_lite *fh_mshc_obj);
void mshc_phy_init(struct fh_mshc_lite *p_mshc, int inv_en);
int fh_mshc_auto_tuning_pata_get(struct fh_mshc_lite *p_mshc);
void phy_dly_setting(struct fh_mshc_lite *p_mshc, u32 tx_dly, u32 rxdata_dly, u32 rxcmd_dly);
#endif
